using System;
using System.Data;
using System.Data.SqlTypes;
using System.Data.SqlClient;

namespace DataEntity
{
	public class T_Project : DBInteractionBase
	{
		#region Class Member Declarations
			private SqlDateTime		_project_SignDate, _project_AgencyDateBegin, _project_AgencyDateEnd;
            private SqlInt32        _project_DeveloperDistrictID, _project_DeveloperCityID, _project_AccountCycle, _project_AccountCondition, _project_DeveloperDistrictPropertyID, _project_PresentID, _project_DeveloperProvinceID, _project_DepartmentID, _project_SignTypeID, _project_Audit, _project_OutComm_ID, _project_Referral_ID;
            private SqlDecimal      _project_AvailableArea, _project_AvailableVolume;
            private SqlString       _projectNOIdx,_project_DepartmentHeadCode, _project_DepartmentHead, _project_BusinessCode, _project_Business, _project_DirecterCode, _project_Manager, _project_Directer1Code, _project_Directer1, _project_Directer, _project_ManagerCode, _project_Developer, _project_Name, _project_NO, _project_DeveloperAddress, _project_AccountCycle_FirstA1, _project_AccountCondition_FirstA1, _project_OutComm_FirstA1, _project_Referral_FirstA1;
			private SqlGuid			_project_ID;
		#endregion

        //public override DataTable SelectAll()
        //{
        //    SqlCommand	cmdToExecute = new SqlCommand();
        //    cmdToExecute.CommandText = "dbo.[sp_t_Project_SelectAll]";
        //    cmdToExecute.CommandType = CommandType.StoredProcedure;
        //    DataTable toReturn = new DataTable("t_Project");
        //    SqlDataAdapter adapter = new SqlDataAdapter(cmdToExecute);

        //    // Use base class' connection object
        //    cmdToExecute.Connection = _mainConnection;

        //    try
        //    {

        //        if(_mainConnectionIsCreatedLocal)
        //        {
        //            // Open connection.
        //            _mainConnection.Open();
        //        }
        //        else
        //        {
        //            if(_mainConnectionProvider.IsTransactionPending)
        //            {
        //                cmdToExecute.Transaction = _mainConnectionProvider.CurrentTransaction;
        //            }
        //        }

        //        // Execute query.
        //        adapter.Fill(toReturn);
        //        return toReturn;
        //    }
        //    catch(Exception ex)
        //    {
        //        // some error occured. Bubble it to caller and encapsulate Exception object
        //        throw new Exception("T_Project::SelectAll::Error occured.", ex);
        //    }
        //    finally
        //    {
        //        if(_mainConnectionIsCreatedLocal)
        //        {
        //            // Close connection.
        //            _mainConnection.Close();
        //        }
        //        cmdToExecute.Dispose();
        //        adapter.Dispose();
        //    }
        //}

		#region Class Property Declarations
		public SqlGuid Project_ID
		{
			get
			{
				return _project_ID;
			}
			set
			{
				_project_ID = value;
			}
		}

        public SqlDecimal Project_AvailableArea
        {
            get 
            {
                return _project_AvailableArea;
            }
            set
            {
                _project_AvailableArea = value;
            }
        }

        public SqlDecimal Project_AvailableVolume
        {
            get
            {
                return _project_AvailableVolume;
            }
            set
            {
                _project_AvailableVolume = value;
            }
        }


		public SqlString Project_NO
		{
			get
			{
				return _project_NO;
			}
			set
			{
				SqlString project_NOTmp = (SqlString)value;
				if(project_NOTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_NO", "Project_NO can't be NULL");
				}
				_project_NO = value;
			}
		}

        public SqlString ProjectNOIdx
        {
            get
            {
                return _projectNOIdx;
            }
            set
            {
                _projectNOIdx = value;
            }
        }


		public SqlDateTime Project_SignDate
		{
			get
			{
				return _project_SignDate;
			}
			set
			{
				SqlDateTime project_SignDateTmp = (SqlDateTime)value;
				if(project_SignDateTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_SignDate", "Project_SignDate can't be NULL");
				}
				_project_SignDate = value;
			}
		}


		public SqlInt32 Project_DepartmentID
		{
			get
			{
				return _project_DepartmentID;
			}
			set
			{
				SqlInt32 project_DepartmentIDTmp = (SqlInt32)value;
				if(project_DepartmentIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_DepartmentID", "Project_DepartmentID can't be NULL");
				}
				_project_DepartmentID = value;
			}
		}


		public SqlString Project_Name
		{
			get
			{
				return _project_Name;
			}
			set
			{
				SqlString project_NameTmp = (SqlString)value;
				if(project_NameTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_Name", "Project_Name can't be NULL");
				}
				_project_Name = value;
			}
		}


		public SqlInt32 Project_SignTypeID
		{
			get
			{
				return _project_SignTypeID;
			}
			set
			{
				SqlInt32 project_SignTypeIDTmp = (SqlInt32)value;
				if(project_SignTypeIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_SignTypeID", "Project_SignTypeID can't be NULL");
				}
				_project_SignTypeID = value;
			}
		}


		public SqlDateTime Project_AgencyDateBegin
		{
			get
			{
				return _project_AgencyDateBegin;
			}
			set
			{
				SqlDateTime project_AgencyDateBeginTmp = (SqlDateTime)value;
				if(project_AgencyDateBeginTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_AgencyDateBegin", "Project_AgencyDateBegin can't be NULL");
				}
				_project_AgencyDateBegin = value;
			}
		}


		public SqlDateTime Project_AgencyDateEnd
		{
			get
			{
				return _project_AgencyDateEnd;
			}
			set
			{
				SqlDateTime project_AgencyDateEndTmp = (SqlDateTime)value;
				if(project_AgencyDateEndTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_AgencyDateEnd", "Project_AgencyDateEnd can't be NULL");
				}
				_project_AgencyDateEnd = value;
			}
		}


		public SqlString Project_Developer
		{
			get
			{
				return _project_Developer;
			}
			set
			{
				SqlString project_DeveloperTmp = (SqlString)value;
				if(project_DeveloperTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_Developer", "Project_Developer can't be NULL");
				}
				_project_Developer = value;
			}
		}


		public SqlInt32 Project_DeveloperProvinceID
		{
			get
			{
				return _project_DeveloperProvinceID;
			}
			set
			{
				SqlInt32 project_DeveloperProvinceIDTmp = (SqlInt32)value;
				if(project_DeveloperProvinceIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_DeveloperProvinceID", "Project_DeveloperProvinceID can't be NULL");
				}
				_project_DeveloperProvinceID = value;
			}
		}


		public SqlInt32 Project_DeveloperCityID
		{
			get
			{
				return _project_DeveloperCityID;
			}
			set
			{
				SqlInt32 project_DeveloperCityIDTmp = (SqlInt32)value;
				if(project_DeveloperCityIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_DeveloperCityID", "Project_DeveloperCityID can't be NULL");
				}
				_project_DeveloperCityID = value;
			}
		}


		public SqlInt32 Project_DeveloperDistrictID
		{
			get
			{
				return _project_DeveloperDistrictID;
			}
			set
			{
				SqlInt32 project_DeveloperDistrictIDTmp = (SqlInt32)value;
				if(project_DeveloperDistrictIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_DeveloperDistrictID", "Project_DeveloperDistrictID can't be NULL");
				}
				_project_DeveloperDistrictID = value;
			}
		}


		public SqlString Project_DeveloperAddress
		{
			get
			{
				return _project_DeveloperAddress;
			}
			set
			{
				SqlString project_DeveloperAddressTmp = (SqlString)value;
				if(project_DeveloperAddressTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_DeveloperAddress", "Project_DeveloperAddress can't be NULL");
				}
				_project_DeveloperAddress = value;
			}
		}


		public SqlInt32 Project_DeveloperDistrictPropertyID
		{
			get
			{
				return _project_DeveloperDistrictPropertyID;
			}
			set
			{
				SqlInt32 project_DeveloperDistrictPropertyIDTmp = (SqlInt32)value;
				if(project_DeveloperDistrictPropertyIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_DeveloperDistrictPropertyID", "Project_DeveloperDistrictPropertyID can't be NULL");
				}
				_project_DeveloperDistrictPropertyID = value;
			}
		}




		public SqlInt32 Project_PresentID
		{
			get
			{
				return _project_PresentID;
			}
			set
			{
				SqlInt32 project_PresentIDTmp = (SqlInt32)value;
				if(project_PresentIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_PresentID", "Project_PresentID can't be NULL");
				}
				_project_PresentID = value;
			}
		}


		public SqlInt32 Project_AccountCycle
		{
			get
			{
				return _project_AccountCycle;
			}
			set
			{
				SqlInt32 project_AccountCycleTmp = (SqlInt32)value;
				if(project_AccountCycleTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_AccountCycle", "Project_AccountCycle can't be NULL");
				}
				_project_AccountCycle = value;
			}
		}


		public SqlInt32 Project_AccountCondition
		{
			get
			{
				return _project_AccountCondition;
			}
			set
			{
				SqlInt32 project_AccountConditionTmp = (SqlInt32)value;
				if(project_AccountConditionTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_AccountCondition", "Project_AccountCondition can't be NULL");
				}
				_project_AccountCondition = value;
			}
		}


		public SqlString Project_DirecterCode
		{
			get
			{
				return _project_DirecterCode;
			}
			set
			{
				SqlString project_DirecterCodeTmp = (SqlString)value;
				if(project_DirecterCodeTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_DirecterCode", "Project_DirecterCode can't be NULL");
				}
				_project_DirecterCode = value;
			}
		}


		public SqlString Project_Directer
		{
			get
			{
				return _project_Directer;
			}
			set
			{
				SqlString project_DirecterTmp = (SqlString)value;
				if(project_DirecterTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_Directer", "Project_Directer can't be NULL");
				}
				_project_Directer = value;
			}
		}


		public SqlString Project_Directer1Code
		{
			get
			{
				return _project_Directer1Code;
			}
			set
			{
				SqlString project_Directer1CodeTmp = (SqlString)value;
				if(project_Directer1CodeTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_Directer1Code", "Project_Directer1Code can't be NULL");
				}
				_project_Directer1Code = value;
			}
		}


		public SqlString Project_Directer1
		{
			get
			{
				return _project_Directer1;
			}
			set
			{
				SqlString project_Directer1Tmp = (SqlString)value;
				if(project_Directer1Tmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_Directer1", "Project_Directer1 can't be NULL");
				}
				_project_Directer1 = value;
			}
		}


		public SqlString Project_ManagerCode
		{
			get
			{
				return _project_ManagerCode;
			}
			set
			{
				SqlString project_ManagerCodeTmp = (SqlString)value;
				if(project_ManagerCodeTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_ManagerCode", "Project_ManagerCode can't be NULL");
				}
				_project_ManagerCode = value;
			}
		}



		public SqlString Project_Manager
		{
			get
			{
				return _project_Manager;
			}
			set
			{
				SqlString project_ManagerTmp = (SqlString)value;
				if(project_ManagerTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Project_Manager", "Project_Manager can't be NULL");
				}
				_project_Manager = value;
			}
		}

        public SqlString Project_Business
        {
            get { return _project_Business; }
            set { _project_Business = value; }
        }

        public SqlString Project_BusinessCode
        {
            get { return _project_BusinessCode; }
            set { _project_BusinessCode = value; }
        }

        public SqlString Project_DepartmentHead
        {
            get { return _project_DepartmentHead; }
            set { _project_DepartmentHead = value; }
        }

        public SqlString Project_DepartmentHeadCode
        {
            get { return _project_DepartmentHeadCode; }
            set { _project_DepartmentHeadCode = value; }
        }

        public SqlString Project_AccountCondition_FirstA1
        {
            get
            {
                return _project_AccountCondition_FirstA1;
            }
            set
            {
                SqlString project_AccountCondition_FirstA1Tmp = (SqlString)value;
                if (project_AccountCondition_FirstA1Tmp.IsNull)
                {
                    throw new ArgumentOutOfRangeException("Project_AccountCondition_FirstA1", "Project_AccountCondition_FirstA1 can't be NULL");
                }
                _project_AccountCondition_FirstA1 = value;
            }
        }

        public SqlString Project_AccountCycle_FirstA1
        {
            get
            {
                return _project_AccountCycle_FirstA1;
            }
            set
            {
                SqlString project_AccountCycle_FirstA1Tmp = (SqlString)value;
                if (project_AccountCycle_FirstA1Tmp.IsNull)
                {
                    throw new ArgumentOutOfRangeException("Project_AccountCycle_FirstA1", "Project_AccountCycle_FirstA1 can't be NULL"); 
                }
                _project_AccountCycle_FirstA1 = value;
            }
        }

        public SqlString Project_OutComm_FirstA1
        {
            get
            {
                return _project_OutComm_FirstA1;
            }
            set
            {
                SqlString project_OutComm_FirstA1Tmp = (SqlString)value;
                if (project_OutComm_FirstA1Tmp.IsNull)
                {
                    throw new ArgumentOutOfRangeException("Project_OutComm_FirstA1", "Project_OutComm_FirstA1 can't be NULL");
                }
                _project_OutComm_FirstA1 = value;
            }
        }

        public SqlString Project_Referral_FirstA1
        {
            get
            {
                return _project_Referral_FirstA1;
            }
            set
            {
                SqlString project_Referral_FirstA1Tmp = (SqlString)value;
                if (project_Referral_FirstA1Tmp.IsNull)
                {
                    throw new ArgumentOutOfRangeException("Project_Referral_FirstA1", "Project_Referral_FirstA1 can't be NULL");
                }
                _project_Referral_FirstA1 = value;
            }
        }


		public SqlInt32 Project_Audit
		{
			get
			{
				return _project_Audit;
			}
			set
			{
                //SqlInt32 project_AuditTmp = (SqlInt32)value;
                //if(project_AuditTmp.IsNull)
                //{
                //    throw new ArgumentOutOfRangeException("Project_Audit", "Project_Audit can't be NULL");
                //}
				_project_Audit = value;
			}
		}

        public SqlInt32 Project_Referral_ID
        {
            get
            {
                return _project_Referral_ID;
            }
            set
            {
                SqlInt32 project_Referral_IDTmp = (SqlInt32)value;
                if (project_Referral_IDTmp.IsNull)
                {
                    throw new ArgumentOutOfRangeException("Project_Referral_ID", "Project_Referral_ID can't be NULL");
                }
                _project_Referral_ID = value;
            }
        }
        public SqlInt32 Project_OutComm_ID
        {
            get
            {
                return _project_OutComm_ID;
            }
            set
            {
                SqlInt32 project_OutComm_IDTmp = (SqlInt32)value;
                if (project_OutComm_IDTmp.IsNull)
                {
                    throw new ArgumentOutOfRangeException("Project_OutComm_ID", "Project_OutComm_ID can't be NULL");
                }
                _project_OutComm_ID = value;
            }
        }



		#endregion

	}
}
